/**
 * http://www.easywayserver.com/blog/java-hashmap-example/
 * 
 * Created on 26 apr. 2011 @ 21:19:33 by Laurens Andriessen
 */

package tests.laurens;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * 
 * @author Laurens Andriessen
 * @version 1.0
 */
public class HashMapTest {

	/**
	 * 
	 * @author Laurens Andriessen
	 * @param args
	 * @return void
	 */
	public static void main(String[] args) {
		HashMap<String, String> servers = new HashMap<String, String>();

		servers.put("testkey1", "testvalue1");
		servers.put("testkey2", "testvalue2");

		Set<?> set = servers.entrySet();

		Iterator<?> it = set.iterator();

		while (it.hasNext()) {
			Map.Entry m = (Map.Entry) it.next();

			String key = (String) m.getKey();
			String value = (String) m.getValue();

			System.out.println("Key: " + key);
			System.out.println("Value: " + value);
			System.out.println("");
		}
	}
}
